#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
int main () 
{ 
    pid_t pid; 
    pid_t pid_f;
    pid_t pid_c;
    pid=fork(); 
    if (pid < 0) 
        printf("error in fork!\n"); 
    else if (pid == 0){
        pid_f = getpid();
        printf("i am the child process, my process id is %d\n",pid_f); 
        sleep(2);
    }
    else{
        pid_c = getpid();
        printf("i am the parent process, my process id is %d\n",pid_c); 
        sleep(5);
    }

    printf("rocess id is %d\n",getpid()); 
    return 0;

} 
